var validPalindrome = function(s){
  function isPalindrome(left,right){
    while(left < right){
      if(s[left] !== a[right]){
        return false;
      }
      left++;
      right--;
    }
    return true;
  }
  let left = 0;
  let right = s.length -1;
  while(left < right){
    if(s[left] !== s[right]){
      let result = isPalindrome(left + 1 ,right) || 
                   isPalindrome(left,right - 1);
      return result;
    }
    left++;
    right--;
  }
  return true;
}